Runtime grouping of tuples in a streaming application

ABSTRACT

A system and method for modifying the processing within a streaming application are disclosed. The method may include identifying a grouping location at which it may be possible to group tuples during the runtime execution of a streaming application. In some embodiments, this may include identifying locations at which a runtime grouping condition may be added to one or more stream operators without adversely affecting the performance of a streaming application. The method may add a runtime grouping condition to a processing location within the plurality of stream operators of a streaming application, in some embodiments.

FIELD

This disclosure generally relates to stream computing, and inparticular, to computing applications that receive streaming data andprocess the data as it is received.

BACKGROUND

Database systems are typically configured to separate the process ofstoring data from accessing, manipulating, or using data stored in adatabase. More specifically, database systems use a model in which datais first stored and indexed in a memory before subsequent querying andanalysis. In general, database systems may not be well suited forperforming real-time processing and analyzing streaming data. Inparticular, database systems may be unable to store, index, and analyzelarge amounts of streaming data efficiently or in real time.

SUMMARY

Embodiments of the disclosure provide a method, system, and computerprogram product for processing data. The method, system, and computerprogram receive streaming data to be processed by a plurality ofprocessing elements comprising one or more stream operators.

One embodiment is directed to a method for processing a stream of tuplesin a streaming application. The method may include identifying agrouping location at which it may be possible to group tuples during theruntime execution of a streaming application. In some embodiments, thismay include identifying locations at which a runtime grouping conditionmay be added to one or more stream operators without adversely affectingthe performance of a streaming application. The method may add a runtimegrouping condition to a processing location within the plurality ofstream operators of a streaming application in some embodiments.

Another embodiment is directed to a system for processing a stream oftuples in a streaming application. The system may include a plurality ofstream operators. The system may identify a grouping location at whichit may be possible to group tuples during the runtime execution of astreaming application. In some embodiments, this may include identifyinglocations at which a runtime grouping condition may be added to one ormore stream operators without adversely affecting the performance of astreaming application. The system may add a runtime grouping conditionto a processing location within the plurality of stream operators of astreaming application in some embodiments.

Yet another embodiment is directed to a computer program product.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a computing infrastructure configured to execute astream computing application according to various embodiments.

FIG. 2 illustrates a more detailed view of a compute node of FIG. 1according to various embodiments.

FIG. 3 illustrates a more detailed view of the management system of FIG.1 according to various embodiments.

FIG. 4 illustrates a more detailed view of the compiler system of FIG. 1according to various embodiments.

FIG. 5 illustrates an operator graph for a stream computing applicationaccording to various embodiments.

FIG. 6 illustrates a method for grouping tuples during runtime accordingto various embodiments.

FIG. 7 illustrates a method for grouping tuples during runtime includingidentifying an output pattern, according to various embodiments.

FIG. 8 illustrates a method for optimizing a grouping of tuples duringruntime according to performance guidance, according to variousembodiments.

FIG. 9 illustrates a method for grouping tuples during runtime includinga system profile observation, according to various embodiments.

FIG. 10 illustrates a more detailed view of an operator graph includinga tuple grouping process, according to various embodiments.

Like reference numbers and designations in the various drawings indicatelike elements.

DETAILED DESCRIPTION

Stream-based computing and stream-based database computing are emergingas a developing technology for database systems. Products are availablewhich allow users to create applications that process and querystreaming data before it reaches a database file. With this emergingtechnology, users can specify processing logic to apply to inbound datarecords while they are “in flight,” with the results available in a veryshort amount of time, often in fractions of a second. Constructing anapplication using this type of processing has opened up a newprogramming paradigm that will allow for development of a broad varietyof innovative applications, systems, and processes, as well as presentnew challenges for application programmers and database developers.

In a stream-based computing application, stream operators are connectedto one another such that data flows from one stream operator to the next(e.g., over a TCP/IP socket). Stream operators may be classified intolevels. A level, as referred to herein, may be defined as a number ofsubsequent stream operators from a particular stream operator.Scalability is achieved by distributing an application across nodes bycreating executables (i.e., processing elements), as well as replicatingprocessing elements on multiple nodes and load balancing among them.Stream operators in a stream computing application can be fused togetherto form a processing element that is executable. Doing so allowsprocessing elements to share a common process space, resulting in muchfaster communication between stream operators than is available usinginter-process communication techniques (e.g., using a TCP/IP socket).Further, processing elements can be inserted or removed dynamically froman operator graph representing the flow of data through the streamcomputing application.

A “tuple” is data. More specifically, a tuple is a sequence of one ormore attributes associated with a thing. Examples of attributes may beany of a variety of different types, e.g., integer, float, Boolean,string, etc. The attributes may be ordered. A tuple may be extended byadding one or more additional attributes to it. In addition toattributes associated with a thing, a tuple may include metadata, i.e.,data about the tuple. As used herein, “stream” or “data stream” refersto a sequence of tuples. Generally, a stream may be considered apseudo-infinite sequence of tuples.

Stream computing applications handle massive volumes of data that needto be processed efficiently and in real time. For example, a streamcomputing application may continuously ingest and analyze hundreds ofthousands of messages per second and up to petabytes of data per day.Accordingly, each stream operator in a stream computing application maybe required to process a received tuple within fractions of a second.

Embodiments disclosed herein are directed to methods and systems thatenhance the ability of a streaming application to efficiently andrapidly process a received data stream. In one embodiment, a groupinglocation may be identified at which tuples may be grouped withoutadversely affecting the performance of the streaming application. It maybe possible to add a runtime grouping condition to a stream operator inorder to specify that tuples be grouped prior to sending to anotherstream operator. A runtime grouping condition may be added to aprocessing location, which may be the same as or different than thegrouping location, within an operator graph of a streaming applicationif a grouping location was identified. A runtime grouping condition mayimprove the performance of a streaming application by reducing the callsto the transport layer during the runtime of the streaming application.

FIG. 1 illustrates one exemplary computing infrastructure 100 that maybe configured to execute a stream-based computing application, accordingto some embodiments. The computing infrastructure 100 includes amanagement system 105 and two or more compute nodes 110A-110D—i.e.,hosts—which are communicatively coupled to each other using one or morecommunications networks 120. The communications network 120 may includeone or more servers, networks, or databases, and may use a particularcommunication protocol to transfer data between the compute nodes110A-110D. A compiler system 102 may be communicatively coupled with themanagement system 105 and the compute nodes 110 either directly or viathe communications network 120.

FIG. 2 is a more detailed view of a compute node 110, which may be thesame as one of the compute nodes 110A-110D of FIG. 1, according tovarious embodiments. The compute node 110 may include, withoutlimitation, one or more processors (CPUs) 205, a network interface 215,an interconnect 220, a memory 225, and a storage 230. The compute node110 may also include an I/O device interface 210 used to connect I/Odevices 212, e.g., keyboard, display, and mouse devices, to the computenode 110.

Each CPU 205 retrieves and executes programming instructions stored inthe memory 225 or storage 230. Similarly, the CPU 205 stores andretrieves application data residing in the memory 225. The interconnect220 is used to transmit programming instructions and application databetween each CPU 205, I/O device interface 210, storage 230, networkinterface 215, and memory 225. The interconnect 220 may be one or morebusses. The CPUs 205 may be a single CPU, multiple CPUs, or a single CPUhaving multiple processing cores in various embodiments. In oneembodiment, a processor 205 may be a digital signal processor (DSP). Oneor more processing elements 235 (described below) may be stored in thememory 225. A processing element 235 may include one or more streamoperators 240 (described below). In one embodiment, a processing element235 is assigned to be executed by only one CPU 205, although in otherembodiments the stream operators 240 of a processing element 235 mayinclude one or more threads that are executed on two or more CPUs 205.The memory 225 is generally included to be representative of a randomaccess memory, e.g., Static Random Access Memory (SRAM), Dynamic RandomAccess Memory (DRAM), or Flash. The storage 230 is generally included tobe representative of a non-volatile memory, such as a hard disk drive,solid state device (SSD), or removable memory cards, optical storage,flash memory devices, network attached storage (NAS), or connections tostorage area network (SAN) devices, or other devices that may storenon-volatile data. The network interface 215 is configured to transmitdata via the communications network 120.

A streams application may include one or more stream operators 240 thatmay be compiled into a “processing element” container 235. The memory225 may include two or more processing elements 235, each processingelement having one or more stream operators 240. Each stream operator240 may include a portion of code that processes tuples flowing into aprocessing element and outputs tuples to other stream operators 240 inthe same processing element, in other processing elements, or in boththe same and other processing elements in a stream computingapplication. Processing elements 235 may pass tuples to other processingelements that are on the same compute node 110 or on other compute nodesthat are accessible via communications network 120. For example, aprocessing element 235 on compute node 110A may output tuples to aprocessing element 235 on compute node 110B.

The storage 230 may include a buffer 260. Although shown as being instorage, the buffer 260 may be located in the memory 225 of the computenode 110 or in a combination of both memories. Moreover, storage 230 mayinclude storage space that is external to the compute node 110, such asin a cloud.

FIG. 3 is a more detailed view of the management system 105 of FIG. 1,according to some embodiments. The management system 105 may include,without limitation, one or more processors (CPUs) 305, a networkinterface 315, an interconnect 320, a memory 325, and a storage 330. Themanagement system 105 may also include an I/O device interface 310connecting I/O devices 312, e.g., keyboard, display, and mouse devices,to the management system 105.

Each CPU 305 retrieves and executes programming instructions stored inthe memory 325 or storage 330. Similarly, each CPU 305 stores andretrieves application data residing in the memory 325 or storage 330.The interconnect 320 is used to move data, such as programminginstructions and application data, between the CPU 305, I/O deviceinterface 310, storage unit 330, network interface 305, and memory 325.The interconnect 320 may be one or more busses. The CPUs 305 may be asingle CPU, multiple CPUs, or a single CPU having multiple processingcores in various embodiments. In one embodiment, a processor 305 may bea DSP. Memory 325 is generally included to be representative of a randomaccess memory, e.g., SRAM, DRAM, or Flash. The storage 330 is generallyincluded to be representative of a non-volatile memory, such as a harddisk drive, solid state device (SSD), removable memory cards, opticalstorage, flash memory devices, network attached storage (NAS),connections to storage area-network (SAN) devices, or the cloud. Thenetwork interface 315 is configured to transmit data via thecommunications network 120.

The memory 325 may store a stream manager 134. Additionally, the storage330 may store an operator graph 335. The operator graph 335 may definehow tuples are routed to processing elements 235 (FIG. 2) forprocessing. In some embodiments, the stream manager 134 may also includea grouping manager 332, which may be configured to monitor and grouptuples during the runtime execution of a streaming application. Thegrouping manager 332 may identify one or more locations within theoperator graph 335 at which it may be possible to group two or moretuples. In some embodiments, a location, referred to hereinafter as agrouping location, within the operator graph 335 at which grouping maybe possible may include one or more stream operators, one or more groupsof stream operators, one or more processing elements, one or more groupsof processing elements, or one or more compute nodes. The groupingmanager 332 may also modify the processing at one or more streamoperators within the identified locations such that tuples are groupedprior to sending to another one or more stream operators during runtime.It may be possible, in some embodiments, to group tuples at one or morestream operators that are not within the location identified by thegrouping manager 332. In some embodiments, identifying a location withinthe operator graph 335 at which grouping may be possible may includeidentifying: an output pattern, a runtime grouping condition that may beoptimized, or a system limitation, such as low network bandwidth. Theidentification of various locations where grouping of tuples may bepossible will be described in further detail below. A location wheregrouping may be possible may be identified, in some embodiments, usingall, none, or any combination of these identification methods.

The grouping manager 332 may modify processing by adding a runtimegrouping condition. A runtime grouping condition, as referred to herein,may identify a condition added during runtime to instruct a particularstream operator or group of operators to group tuples prior to sendingto another stream operator or group of stream operators. The performanceof the streaming application may be improved by applying one or moreruntime grouping conditions to the operator graph 335. For example, aruntime grouping condition may reduce the number of calls to thetransport layer, which may result in improved application performance.

FIG. 4 is a more detailed view of the compiler system 102 of FIG. 1according to some embodiments. The compiler system 102 may include,without limitation, one or more processors (CPUs) 405, a networkinterface 415, an interconnect 420, a memory 425, and storage 430. Thecompiler system 102 may also include an I/O device interface 410connecting I/O devices 412, e.g., keyboard, display, and mouse devices,to the compiler system 102.

Each CPU 405 retrieves and executes programming instructions stored inthe memory 425 or storage 430. Similarly, each CPU 405 stores andretrieves application data residing in the memory 425 or storage 430.The interconnect 420 is used to move data, such as programminginstructions and application data, between the CPU 405, I/O deviceinterface 410, storage unit 430, network interface 415, and memory 425.The interconnect 420 may be one or more busses. The CPUs 405 may be asingle CPU, multiple CPUs, or a single CPU having multiple processingcores in various embodiments. In one embodiment, a processor 405 may bea DSP. Memory 425 is generally included to be representative of a randomaccess memory, e.g., SRAM, DRAM, or Flash. The storage 430 is generallyincluded to be representative of a non-volatile memory, such as a harddisk drive, solid state device (SSD), removable memory cards, opticalstorage, flash memory devices, network attached storage (NAS),connections to storage area-network (SAN) devices, or to the cloud. Thenetwork interface 415 is configured to transmit data via thecommunications network 120.

The memory 425 may store a compiler 136. The compiler 136 compilesmodules, which include source code or statements, into the object code,which includes machine instructions that execute on a processor. In oneembodiment, the compiler 136 may translate the modules into anintermediate form before translating the intermediate form into objectcode. The compiler 136 may output a set of deployable artifacts that mayinclude a set of processing elements and an application descriptionlanguage file (ADL file), which is a configuration file that describesthe streaming application. In some embodiments, the compiler 136 may bea just-in-time compiler that executes as part of an interpreter. Inother embodiments, the compiler 136 may be an optimizing compiler. Invarious embodiments, the compiler 136 may perform peepholeoptimizations, local optimizations, loop optimizations, inter-proceduralor whole-program optimizations, machine code optimizations, or any otheroptimizations that reduce the amount of time required to execute theobject code, to reduce the amount of memory required to execute theobject code, or both.

The compiler 136 may also provide the application administrator with theability to optimize performance through profile-driven fusionoptimization. Fusing operators may improve performance by reducing thenumber of calls to a transport. While fusing stream operators mayprovide faster communication between operators than is available usinginter-process communication techniques, any decision to fuse operatorsrequires balancing the benefits of distributing processing acrossmultiple compute nodes with the benefit of faster inter-operatorcommunications. The compiler 136 may automate the fusion process todetermine how to best fuse the operators to be hosted by one or moreprocessing elements, while respecting user-specified constraints. Thismay be a two-step process, including compiling the application in aprofiling mode and running the application, then re-compiling and usingthe optimizer during this subsequent compilation. The end result may,however, be a compiler-supplied deployable application with an optimizedapplication configuration.

FIG. 5 illustrates an exemplary operator graph 500 for a streamcomputing application beginning from one or more sources 135 through toone or more sinks 504, 506, according to some embodiments. This flowfrom source to sink may also be generally referred to herein as anexecution path. Although FIG. 5 is abstracted to show connectedprocessing elements PE1-PE10, the operator graph 500 may include dataflows between stream operators 240 (FIG. 2) within the same or differentprocessing elements. Typically, processing elements, such as processingelement 235 (FIG. 2), receive tuples from the stream as well as outputtuples into the stream (except for a sink—where the stream terminates,or a source—where the stream begins).

The example operator graph shown in FIG. 5 includes ten processingelements (labeled as PE1-PE10) running on the compute nodes 110A-110D. Aprocessing element may include one or more stream operators fusedtogether to form an independently running process with its own processID (PID) and memory space. In cases where two (or more) processingelements are running independently, inter-process communication mayoccur using a “transport,” e.g., a network socket, a TCP/IP socket, orshared memory. However, when stream operators are fused together, thefused stream operators can use more rapid communication techniques forpassing tuples among stream operators in each processing element.

The operator graph 500 begins at a source 135 and ends at a sink 504,506. Compute node 110A includes the processing elements PE1, PE2, andPE3. Source 135 flows into the processing element PE1, which in turnoutputs tuples that are received by PE2 and PE3. For example, PE1 maysplit data attributes received in a tuple and pass some data attributesin a new tuple to PE2, while passing other data attributes in anothernew tuple to PE3. As a second example, PE1 may pass some received tuplesto PE2 while passing other tuples to PE3. Data that flows to PE2 isprocessed by the stream operators contained in PE2, and the resultingtuples are then output to PE4 on compute node 110B Likewise, the tuplesoutput by PE4 flow to operator sink PE6 504. Similarly, tuples flowingfrom PE3 to PE5 also reach the operators in sink PE6 504. Thus, inaddition to being a sink for this example operator graph, PE6 could beconfigured to perform a join operation, combining tuples received fromPE4 and PE5. This example operator graph also shows tuples flowing fromPE3 to PE7 on compute node 110C, which itself shows tuples flowing toPE8 and looping back to PE7. Tuples output from PE8 flow to PE9 oncompute node 110D, which in turn outputs tuples to be processed byoperators in a sink processing element, for example PE10 506.

The tuple received by a particular processing element 235 (FIG. 2) isgenerally not considered to be the same tuple that is output downstream.Typically, the output tuple is changed in some way. An attribute ormetadata may be added, deleted, or changed. However, it is not requiredthat the output tuple be changed in some way. Generally, a particulartuple output by a processing element may not be considered to be thesame tuple as a corresponding input tuple even if the input tuple is notchanged by the processing element. However, to simplify the presentdescription and the claims, an output tuple that has the same dataattributes as a corresponding input tuple may be referred to herein asthe same tuple.

Processing elements 235 (FIG. 2) may be configured to receive or outputtuples in various formats, e.g., the processing elements or streamoperators could exchange data marked up as XML documents. Furthermore,each stream operator 240 within a processing element 235 may beconfigured to carry out any form of data processing functions onreceived tuples, including, for example, writing to database tables orperforming other database operations such as data joins, splits, reads,etc., as well as performing other data analytic functions or operations.

The stream manager 134 of FIG. 1 may be configured to monitor a streamcomputing application running on compute nodes, e.g., compute nodes110A-110D, as well as to change the deployment of an operator graph,e.g., operator graph 132. The stream manager 134 may move processingelements from one compute node 110 to another, for example, to managethe processing loads of the compute nodes 110A-110D in the computinginfrastructure 100. Further, stream manager 134 may control the streamcomputing application by inserting, removing, fusing, un-fusing, orotherwise modifying the processing elements and stream operators (orwhat tuples flow to the processing elements) running on the computenodes 110A-110D. One example of a stream computing application is IBM®'sInfoSphere® Streams (note that InfoSphere® is a trademark ofInternational Business Machines Corporation, registered in manyjurisdictions worldwide).

Because a processing element may be a collection of fused streamoperators, it is equally correct to describe the operator graph as oneor more execution paths between specific stream operators, which mayinclude execution paths to different stream operators within the sameprocessing element. FIG. 5 illustrates execution paths betweenprocessing elements for the sake of clarity.

FIG. 6 is a flowchart illustrating a method 600 for modifying processingof a data stream, according to some embodiments. Generally, theoperations of the method 600 may modify the processing of a stream oftuples within an operator graph by identifying one or more locationswhere it may be possible to group tuples prior to sending in an attemptto improve the overall performance of the streaming application. In someembodiments, processing may be modified by grouping tuples and addingone or more runtime grouping conditions to one or more stream operatorsbased on the identification. Runtime grouping conditions may be addedduring the runtime execution of a streaming application. The addition ofone or more runtime grouping conditions may include monitoring astreaming application during runtime through the use of a groupingmanager, such as grouping manager 332 (FIG. 3), in some embodiments. Thegrouping manager 332 may add one or more runtime grouping conditions toone or more stream operators at one or more of the grouping locationsidentified by the grouping manager 332. Alternatively, one or moreruntime grouping conditions may be added to one or more stream operatorsat a processing location, which may be the same as or different than thegrouping location identified by the grouping manager 332. A runtimegrouping condition may specify that tuples be grouped based on themanner of identifying a location with potential for grouping. In someembodiments, identifying a grouping location where grouping tuples mayimprove the performance of a streaming application may be based on:patterns exhibited during the runtime of the streaming application(discussed in further detail at operation 700), performance guided trialand error (discussed in further detail at operation 800), orcharacteristics related to a system profile (discussed in further detailat operation 900).

At operation 610, a streaming application may be monitored during itsruntime execution, according to some embodiments. Monitoring a streamingapplication may be accomplished through a grouping manager, such asgrouping manager 332 (FIG. 3). The grouping manager 332 may beconfigured to monitor a streaming application during runtime to identifylocations within an operator graph at which tuples may be grouped.Grouping tuples may improve the performance of a streaming application.

At operation 620, a grouping manager, e.g., grouping manager 332, maygroup tuples based on whether the grouping manager 332 identifies apattern exhibited during the runtime of a streaming application,according to some embodiments. This may include (as further described inFIG. 7) identifying output patterns based on: a tuple count, a period oftime, a windowing condition, a value of an attribute within a tuple, ora punctuation, in some embodiments. At operation 630, the groupingmanager 332 may group tuples based on a trial and error method which mayinclude performance metrics as a guide, in some embodiments. Operation630 may generally be considered a trial and error method of optimizingruntime tuple grouping based on system performance metrics. Operation630 is discussed in further detail below in accordance with FIG. 8. Atoperation 640, the grouping manager 332 may group tuples based onmonitoring a system profile, according to some embodiments. Operation640 may generally be considered a method of grouping tuples to preservesystem resources, thereby improving application performance. Operation640 is discussed in further detail below in accordance with FIG. 9.

A grouping manager, e.g., grouping manager 332 (FIG. 3), may beconfigured to include operations 620-640 in some embodiments. In otherembodiments, the grouping manager 332 may be configured to include anyone of the operations 620-640, or any combination of the operations620-640. A grouping manager may be configured to include operations620-640 in some embodiments. In some embodiments, however, anapplication programmer may disable the grouping manager 332. Operations620-640 may, in some embodiments, run concurrently. In otherembodiments, the operations 620-640 may run sequentially. In such anembodiment, the order may not affect the streaming application.

At operation 650, processing according to the operator graph of thestreaming application may continue, according to some embodiments.Continuing processing may include grouping of tuples if any runtimegrouping conditions were added in the preceding operations. Continuingprocessing may also include a grouping manager, e.g., grouping manager332, continuing to monitor the application, as shown by the arrow inFIG. 6 indicating that the method 600 may repeat throughout the runtimeof the streaming application.

FIG. 7 is a flowchart illustrating a method 700 corresponding tooperation 620 (FIG. 6) to group tuples based on the runtimeidentification of an output pattern, according to some embodiments. Atoperation 710, a grouping manager, e.g., grouping manager 332 (FIG. 3),may identify an output pattern. An output pattern may generally beconsidered to be a recurring output during runtime of a streamingapplication. An output pattern may be identified at a particular streamoperator in some embodiments. Output patterns may be identified within aparticular group of stream operators, at a particular processingelement, or within a group of processing elements in other embodiments.Output patterns may include patterns that are based on: a tuple count, aperiod of time, a windowing condition, a value of an attribute within atuple, or a punctuation. A punctuation is a control signal that appearsinterleaved with the tuples in a data stream. The punctuation may, forexample, notify the stream operator of the grouping of tuples to beprocessed.

A window, as referred to herein, is a logical container for tuplesreceived by an input port of a stream operator. Windowing may allow forcreation of subsets of data within a streaming application. A streamoperator may not necessarily support windowing by default. A streamoperator may, however, be configured to support windowing. Both tumblingand sliding windows may store tuples according to various conditions. Atumbling window may store incoming tuples until the window is full, thenmay trigger a stream operator behavior, flush all stored tuples from thewindow, and then may begin this process again. Conversely, a slidingwindow does not automatically flush the window when the triggercondition is fulfilled. A sliding window also has an eviction policythat tells the window when to flush the window and begin this processagain. These conditions may be referred to herein as windowingconditions. Windowing may be defined in any number of ways. For example,an application programmer may define one or more specific windowingconditions. Additionally, the system may provide a set of windowingconditions.

A grouping manager, e.g., grouping manager 332, may, for example,identify a stream operator that outputs one tuple for every five tuplesreceived. In another embodiment, the grouping manager 332 may identify astream operator that outputs a tuple whenever it receives a punctuation.The grouping manager 332 may also identify a stream operator receivinginput from two or more stream operators that outputs one tuple wheneverit receives an input from a particular stream operator of the two ormore input stream operators, in some embodiments. In other embodiments,the grouping manager 332 may identify a stream operator that producesoutput only after receiving one or more input streams from multipleoperators.

At operation 720, a grouping manager, e.g., grouping manager 332 (FIG.3), may determine whether a pattern was identified and modify processingaccordingly. If the grouping manager 332 was able to identify an outputpattern, then it may apply a runtime grouping condition at operation 730(discussed below). A runtime grouping condition may be based on theoutput pattern that was identified. Conversely, if the grouping manager332 is unable to identify an output pattern during runtime, i.e., thegrouping manager did not identify a grouping location, the groupingmanager 332 may continue to attempt to identify output patterns. In someembodiments, even when the grouping manager 332 is able to identify anoutput pattern during runtime, the grouping manager 332 may stillcontinue to attempt to identify additional output patterns.

At operation 730, the grouping manager 332 may modify processing at oneor more stream operators, in some embodiments. The modification to theone or more stream operators may include adding a runtime groupingcondition within the grouping location identified by the groupingmanager 332. In other embodiments, the modification may include adding aruntime grouping condition at a processing location, which may be thesame as or different than the grouping location. The runtime groupingcondition may notify one or more stream operators to group tuples basedon a corresponding output pattern. When processing a group of tuples, astream operator may execute a process n times, where n is the number oftuples that was included in the group.

If a grouping manager, e.g., grouping manager 332, identified a groupinglocation at operation 710 in which a stream operator outputs one tuplefor every five tuples received, the grouping manager 332 may apply aruntime grouping condition such that tuples are sent to that particularstream operator in groups containing five tuples. The grouping manager332 may also modify the processing to include a group size that isgreater than one, but less than five. If the grouping manager 332identified a grouping location in which a stream operator outputs onetuple every ten seconds the streaming application is running, thegrouping manager 332 may add a runtime grouping condition to aprocessing location such that tuples are grouped for some amount of timeless than ten seconds prior to sending the group to the particularstream operator that exhibits the pattern. In some embodiments, theprocessing location and the grouping location may be different.

FIG. 8 is a flowchart illustrating a method 800 corresponding tooperation 630 (FIG. 6) to group tuples based on a trial and error methodto optimize tuple grouping within an operator graph of a streamingapplication, according to some embodiments. At operation 810, a groupingmanager, e.g., grouping manager 332 (FIG. 3), may be configured to takea performance metric baseline P₀. The performance metric baseline mayinclude information relating to a portion of the application or theentire application, according to some embodiments. Performance metricsmay include, for example, CPU utilization, number of processing elementson a compute node, network interface controller/card (NIC) bandwidthremaining, or other similar performance indicators. In some embodiments,the performance metrics may also include information regardingprocessing times, such as the average amount of time a tuple spends inan operator graph, the average amount of time an operator takes toprocess a tuple, the average amount of time a group of operators takesto process a tuple, or other similar indicators of the streamingapplication's performance. In some embodiments, the grouping manager 332may write the performance baseline P₀ to a memory.

At operation 820, a grouping manager, e.g., grouping manager 332 (FIG.3), may add a trial runtime grouping condition. As referred to herein, atrial runtime grouping condition is a runtime grouping condition that isadded to a streaming application by the grouping manager 332 that may,in some embodiments, be retained in the operator graph if performancemetrics improve (discussed in further detail at operation 870). A trialruntime grouping condition may be similar to a runtime groupingcondition. The grouping manager 332 may identify a grouping locationusing various methods. For example, in some embodiments, the groupingmanager 332 may identify a potential grouping location based on a systemdefault. In other embodiments, the grouping manager 332 may identify apotential grouping location based on an input received from a compileror provided by an application programmer. In yet other embodiments, thegrouping manager 332 may identify a grouping location based on theoutput pattern method described in operation 700.

At operation 830, a grouping manager, e.g., grouping manager 332 (FIG.3), may take a new performance baseline P_(n), according to someembodiments. This performance baseline P_(n) may be an indication ofwhether the trial runtime grouping condition improved the performance ofthe streaming application. In some embodiments, similar metrics to theinitial performance baseline P₀ may be taken. At operation 840, thegrouping manager 332 may determine whether the performance baselineP_(n) shows an improvement in the performance of the streamingapplication as compared to the initial performance baseline P₀. Forexample, operation 840 may determine that the trial runtime groupingcondition decreased the amount of time one or more stream operatorstakes to process one or more tuples. If the grouping manager 332determines at operation 840 that the performance baseline P_(n)indicates a decreased performance of the streaming application, thegrouping manager 332 may take a snapshot of the system and log thesnapshot along with the trial grouping condition at operation 845 inorder to keep records of attempted runtime grouping conditions. Thesnapshot may include system details similar to those identified by theperformance baseline of operations 810 and 830.

At operation 850, the grouping manager 332 may modify the trial runtimegrouping condition and repeat operations 830 and 840. In someembodiments, operations 830-850 may be repeated n number of times beforethe operation 800 is ended. The number n may be based on the potentialnumber of grouping combinations. In other embodiments, the operation 800may run for a period of time, at the end of which the trial runtimegrouping condition providing the best performance may be retained.Conversely, if the grouping manager 332 determines at operation 840 thatthe performance baseline P_(n) indicates improved performance of thestreaming application, the grouping manager 332 may take a snapshot ofthe system at operation 860. The snapshot may include system detailssimilar to those identified by the performance baseline of operations810 and 830. At operation 870, the grouping manager 332 may log thesnapshot of the system and include the trial runtime grouping conditionin the log as well, according to some embodiments. At operation 880, thegrouping manager 332 may retain the trial grouping condition as theruntime grouping condition.

FIG. 9 is a flowchart illustrating a method 900 corresponding tooperation 640 (FIG. 6) to group tuples based on monitoring a systemprofile, according to some embodiments. At operation 640, a groupingmanager, e.g., grouping manager 332, may be configured to monitor asystem profile during runtime execution of a streaming application. A“system” as referred herein may include one or more compute nodes, suchas compute node 110 (FIG. 2), according to some embodiments. The systemprofile may include information related to one or more network interfacecontrollers/cards (NIC) of a system in some embodiments. Thisinformation may, for example, include the remaining available bandwidthon the NIC. At operation 720, the grouping manager 332 may determinewhether the NIC is running low on bandwidth. In some embodiments, thepoint at which the grouping manager 332 decides that a NIC has crossed abandwidth threshold may be a user-defined value input by the applicationprogrammer. In other embodiments, the NIC threshold may be identified asa system default value. In yet other embodiments, a system defaultthreshold may be overridden by an application programmer. The NICthreshold may also be determined historically in some embodiments. Ifthe runtime manager 332 identifies a NIC running low on bandwidth duringruntime execution of a streaming application, the runtime manager 332may identify grouping locations within the operator graph.

For example, it may be possible to group tuples prior to sending to astream operator that outputs one tuple every five seconds, but thereceiving tuple only outputs one tuple every fifteen seconds. In such acase, it may be possible to send a group of tuples every ten seconds. Inaddition to time-based grouping locations, grouping may be possiblebased on identification of locations based on windowing conditions,tuple counts, punctuation, tuple attribute values, or any combinationthereof. In some embodiments, grouping tuples may be discontinued afterthe NIC bandwidth is back above the provided threshold.

At operation 930, a grouping manager, e.g., grouping manager 332, maymodify processing at one or more stream operators within a groupinglocation identified in operation 910. In other embodiments, themodification may be at a processing location, which may be the same asor different than the grouping location identified in operation 910. Themodification to the one or more stream operators may include adding aruntime grouping condition. The runtime grouping condition may notifyone or more stream operators to group tuples based on a correspondingsystem profile characteristic. When processing a group of tuples, astream operator may execute a process n times, where n is the number oftuples that was included in the group.

If a grouping manager, e.g., grouping manager 332, identified a groupinglocation based on a system profile characteristic at operation 910, thegrouping manager 332 may add a runtime grouping condition to a streamoperator within the operator graph at operation 930. In someembodiments, this runtime grouping condition may be added to one or morestream operators within the grouping location that was identified by thegrouping manager 332. In other embodiments, the runtime groupingcondition may be added to a processing location, which may be the sameas or different than the grouping location.

In some embodiments, for example, if the NIC bandwidth is below aspecified threshold, a grouping manager, e.g., grouping manager 332, maygroup tuples prior to sending to a particular stream operator thatoutputs one tuple after fifty tuples are received. The grouping may, forexample, indicate that fifty tuples are to be grouped prior to sendingto this particular stream operator, thereby reducing the number of timesthe NIC is used. In addition to count-based locations, grouping may bepossible at locations based on windowing conditions, processing time,punctuation, tuple attribute values, or any combination thereof. In someembodiments, it may be possible to stop grouping tuples after the NICbandwidth is back above the provided threshold.

FIG. 10 shows a more detailed view of operator graph 1000 of a streamingapplication in which incoming tuples may be grouped, according to someembodiments. Operator graph 1000 shows a simplified execution path forillustrative purposes. In some embodiments, a grouping manager, e.g.,grouping manager 332 (FIG. 3), may be configured to monitor a streamingapplication during runtime execution. The grouping manager 332 mayidentify grouping locations. For example, the grouping manager 332 mayidentify that stream operator 1030 outputs one tuple for every fivetuples that it receives. The grouping manager 332 may be able to add aruntime grouping condition based on this output pattern to a streamoperator within the operator graph 1000. For example, in someembodiments, the grouping manager 332 may add a grouping condition tostream operator 1020 such that stream operator 1020 outputs a group oftuples containing five tuples instead of sending five individual tuplesto stream operator 1030. This may improve the performance by reducingthe number of calls that stream operator 1020 has to make to thetransport layer.

In other embodiments, the grouping manager 332 may determine that theNIC is running low on remaining available bandwidth. The groupingmanager 332 may then identify grouping locations at which grouping mayreduce the number of calls to the transport layer in an attempt todecrease the load on the NIC. For example, the grouping manager 332 mayidentify that stream operator 1030 outputs one tuple every five seconds.Stream operator 1050 may also output one tuple every ten seconds. Inthis case, the grouping manager 332 may identify that it is possible togroup tuples prior to sending from stream operator 1030 to streamoperator 1050 without affecting the performance of stream operator 1050.This may be accomplished by adding runtime grouping condition 1070 tostream operator 1030. In some embodiments, runtime grouping condition1070 may group tuples prior to sending every ten seconds. Groupingtuples prior to sending them to stream operator 1030 may reduce thenumber of calls made to the transport layer, which may increase theamount of available bandwidth on the NIC.

In the foregoing, reference is made to various embodiments. It should beunderstood, however, that this disclosure is not limited to thespecifically described embodiments. Instead, any combination of thedescribed features and elements, whether related to differentembodiments or not, is contemplated to implement and practice thisdisclosure. Furthermore, although embodiments of this disclosure mayachieve advantages over other possible solutions or over the prior art,whether or not a particular advantage is achieved by a given embodimentis not limiting of this disclosure. Thus, the described aspects,features, embodiments, and advantages are merely illustrative and arenot considered elements or limitations of the appended claims exceptwhere explicitly recited in a claim(s).

As will be appreciated by one skilled in the art, aspects of the presentdisclosure may be embodied as a system, method, or computer programproduct. Accordingly, aspects of the present disclosure may take theform of an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.), or anembodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit,” “module,” or “system.”Furthermore, aspects of the present disclosure may take the form of acomputer program product embodied in one or more computer readablemedium(s) having computer readable program code embodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, or device, or any suitable combination thereof. More specificexamples (a non-exhaustive list) of the computer readable storage mediumwould include the following: an electrical connection having one or morewires, a portable computer diskette, a hard disk, a random access memory(RAM), a read-only memory (ROM), an erasable programmable read-onlymemory (EPROM or Flash memory), an optical fiber, a portable compactdisc read-only memory (CD-ROM), an optical storage device, a magneticstorage device, or any suitable combination thereof. In the context ofthis disclosure, a computer readable storage medium may be any tangiblemedium that can contain, or store, a program for use by or in connectionwith an instruction execution system, apparatus, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wire line, optical fiber cable, RF, etc., or any suitable combinationthereof.

Computer program code for carrying out operations for aspects of thepresent disclosure may be written in any combination of one or moreprogramming languages, including: (a) an object oriented programminglanguage such as Java, Smalltalk, C++, or the like; (b) conventionalprocedural programming languages, such as the “C” programming languageor similar programming languages; and (c) a streams programminglanguage, such as IBM Streams Processing Language (SPL). The programcode may execute as specifically described herein. In addition, theprogram code may execute entirely on the user's computer, partly on theuser's computer, as a stand-alone software package, partly on the user'scomputer and partly on a remote computer, or entirely on the remotecomputer or server. In the latter scenario, the remote computer may beconnected to the user's computer through any type of network, includinga local area network (LAN) or a wide area network (WAN), or theconnection may be made to an external computer (for example, through theInternet using an Internet Service Provider).

Aspects of the present disclosure have been described with reference toflowchart illustrations, block diagrams, or both, of methods,apparatuses (systems), and computer program products according toembodiments of this disclosure. It will be understood that each block ofthe flowchart illustrations or block diagrams, and combinations ofblocks in the flowchart illustrations or block diagrams, can beimplemented by computer program instructions. These computer programinstructions may be provided to a processor of a general purposecomputer, special purpose computer, or other programmable dataprocessing apparatus to produce a machine, such that the instructions,which execute via the processor of the computer or other programmabledata processing apparatus, create means for implementing the functionsor acts specified in the flowchart or block diagram block or blocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions whichimplement the function or act specified in the flowchart or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus, or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions or acts specified in the flowchart or blockdiagram block or blocks.

Embodiments according to this disclosure may be provided to end-usersthrough a cloud-computing infrastructure. Cloud computing generallyrefers to the provision of scalable computing resources as a serviceover a network. More formally, cloud computing may be defined as acomputing capability that provides an abstraction between the computingresource and its underlying technical architecture (e.g., servers,storage, networks), enabling convenient, on-demand network access to ashared pool of configurable computing resources that can be rapidlyprovisioned and released with minimal management effort or serviceprovider interaction. Thus, cloud computing allows a user to accessvirtual computing resources (e.g., storage, data, applications, and evencomplete virtualized computing systems) in “the cloud,” without regardfor the underlying physical systems (or locations of those systems) usedto provide the computing resources.

Typically, cloud-computing resources are provided to a user on apay-per-use basis, where users are charged only for the computingresources actually used (e.g., an amount of storage space used by a useror a number of virtualized systems instantiated by the user). A user canaccess any of the resources that reside in the cloud at any time, andfrom anywhere across the Internet. In context of the present disclosure,a user may access applications or related data available in the cloud.For example, the nodes used to create a stream computing application maybe virtual machines hosted by a cloud service provider. Doing so allowsa user to access this information from any computing system attached toa network connected to the cloud (e.g., the Internet).

The flowchart and block diagrams in the figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present disclosure. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams or flowchart illustration, andcombinations of blocks in the block diagrams or flowchart illustration,can be implemented by special purpose hardware-based systems thatperform the specified functions or acts, or combinations of specialpurpose hardware and computer instructions.

Although embodiments are described within the context of a streamcomputing application, this is not the only context relevant to thepresent disclosure. Instead, such a description is without limitationand is for illustrative purposes only. Of course, one of ordinary skillin the art will recognize that embodiments of the present invention maybe configured to operate with any computer system or application capableof performing the functions described herein. For example, embodimentsof the invention may be configured to operate in a clustered environmentwith a standard database processing application.

While the foregoing is directed to exemplary embodiments, other andfurther embodiments of the invention may be devised without departingfrom the basic scope thereof, and the scope thereof is determined by theclaims that follow.

1. A method for processing a stream of tuples, comprising: receiving astream of tuples to be processed by a plurality of processing elementsoperating on one or more computer processors, each processing elementhaving one or more stream operators; identifying a grouping locationwithin the plurality of stream operators to modify processing the streamof tuples during runtime; and modifying processing at a first streamoperator within a processing location, the modifying including adding aruntime grouping condition to the first stream operator such that thefirst stream operator groups a plurality of tuples to send to a secondstream operator.
 2. The method of claim 1, wherein the grouping locationand the processing location are different locations.
 3. The method ofclaim 1, wherein the first stream operator and the second streamoperator are the same stream operator.
 4. The method of claim 1, whereinthe grouping location includes a plurality of stream operators.
 5. Themethod of claim 1, wherein the grouping location includes a processingelement.
 6. The method of claim 1, wherein identifying includesdetermining whether the second stream operator exhibits an outputpattern.
 7. The method of claim 1, wherein identifying includesdetermining whether a characteristic of a system profile has crossed athreshold.
 8. The method of claim 1, wherein identifying includesoptimizing the runtime grouping condition.
 9. The method of claim 1,wherein the grouping location includes the second stream operatorconfigured to write output to a memory.
 10. The method of claim 1,wherein the runtime grouping condition is determined by a defaultcondition. 11-20. (canceled)